<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <title>后台管理面板</title>
  <!-- 告诉浏览器该页面是自适应布局 -->
  <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
  {include file="../application/admin/view/index/top.html" /}
</head>
<body class="hold-transition skin-blue sidebar-mini">	
<div class="wrapper">
    <div class="content-wrapper" style="margin-left: 0 !important;">
        <!--页眉-->
        <section class="content-header">
          <h1>插件管理列表</h1>
        </section>
        <!--内容开始-->
        <section class="content">
            <div class="search">
            	<form class="form-inline">
                 	<e>可在线安装、卸载、禁用、启用插件</e>
                    <!--<a class="btn btn-flat btn-primary m_10" href="" target="_blank">插件商店</a>-->
                </form> 
            </div>
            <!--数据表开始-->
            <div class="row">
                <div class="col-xs-12">
                  <div class="box">
                    <div class="box-header">
                    <!-- /.box-header -->
                    <div class="box-body table-responsive no-padding">
                      <table class="table table-bordered table-hover">
                        <tr>
                          <th class="t_c">插件名称</th>
                          <th class="t_c">插件目录</th>
                          <th class="t_c">插件介绍</th>
                          <th class="t_c">版本号</th>
                          <th class="t_c">作者</th>
                          <th class="t_c">关联钩子</th>
                          <th class="t_c">启用状态</th>
                          <th class="t_c">操作</th>
                        </tr>
                        {volist name='list' id='list' empty="$empty"}
                        <tr>
                          <td class="t_c">{$list.title}</td>
                          <td class="t_c">{$list.name}</td>
                          <td class="t_c">{$list.description}</td>
                          <td class="t_c">{$list.version}</td>
                          <td class="t_c">{$list.author}</td>
                          <td class="t_c">{$list.addons}</td>
                         <td class="t_c">
                          	{if $list.status==1}
                          		<a class="state state_ok" data-id="{$list.name}"><i class="fa fa-fw fa-check-square"></i></a>
                          	{else}
                          		<a class="state state_no" data-id="{$list.name}"><i class="fa fa-fw fa-check-square"></i></a>
                          	{/if}
                          </td>
                          
                          <td class="t_c">
                          	 {if $list.haveConfig}
                          	  <a class="btn btn-flat btn-success btn-xs" href="{:url('config',['name'=>$list.name])}">
                                <i class="fa fa-plus"></i> 配置
                              </a>
                              {/if}
                              {if $list.install}
                              <a class="btn btn-flat btn-warning btn-xs list_del" data-id="{$list.name}">
                                <i class="fa fa-trash-o"></i> 卸载
                              </a>
                              {else}
	                          <a class="btn btn-flat btn-info btn-xs" href="{:url('install',['name'=>$list.name])}">
                                <i class="fa fa-edit"></i> 安装
                              </a>
                              {/if}
                          </td>
                        </tr>
                        {/volist}                       
                      </table>
                    </div>
                    <!-- /.box-body -->
                  </div>
                  <!-- /.box -->
                </div>
              </div>
            <!--数据表结束-->
        </section>
        <!-- right col -->
      </div>
      <!-- /.row (main row) -->

    </section>
        <!--内容结束-->
    </div>
</div>
{include file="../application/admin/view/index/bottom.html" /} 

<script>
	//设置状态
	$(".state").click(function(){
		var url = "{:url('state')}";
		var id = $(this).data("id");
		changeState(url,id);
	})
	
	//卸载
	$(".list_del").click(function(){
		var url = "{:url('uninstall')}";
		var id = $(this).data("id");
		uninstallOne(url,id)
	})
</script>
</body>
</html>    